<style>
    .daterangepicker.dropdown-menu, .select2-container--open {
        z-index: 99999999;
    }
    .select2-container--default .select2-selection--single, .select2-selection .select2-selection--single {
        height:30px;
    }
    .layui-layer-shade  {
        left:inherit;
        top:50px;
        position:absolute;
    }
</style>
<div class="row" id="myapp">
    <pop-tree-organization-component></pop-tree-organization-component>

    <div class="col-xs-12" style="margin-bottom:10px;">
        <div style="background-color:#ffffff;overflow:hidden;padding:0 10px 10px 10px;border:1px solid #d2d6de;">
            <div style="float:left;margin-left:10px;margin-top:10px;">
                <span style="float:left;line-height:32px;">结算时间：</span>
                <div class="input-group input-group-sm" style="width: 250px;float:left;">
                    <div class="input-group-addon"><i class="fa fa-calendar"></i></div>
                    <input type="text" v-model="data_cycle" id="data_cycle" class="form-control pull-right" readonly>
                </div>
            </div>
            <div style="float:left;margin-left:10px;;margin-top:10px;">
                <span style="float:left;line-height:32px;">结算机构：</span>
                <div class="input-group input-group-sm" style="width: 250px;">
                    <input type="text" v-model="organization_names" @click="openTreeOrganizationWin" class="form-control pull-right" readonly>
                </div>
            </div>
            <div class="clear"></div>
            <div style="float:left;margin-left:10px;;margin-top:10px;">
                <button @click="query()" type="button" class="btn btn-block btn-info btn-sm" style="width:100px;">查询</button>
            </div>
            <div style="float:left;margin-left:10px;;margin-top:10px;">
                <button @click="reset_query()" type="button" class="btn btn-default btn-sm" style="width:100px;">重置</button>
            </div>
            <div style="float:left;margin-left:10px;;margin-top:10px;display: none;">
                <button @click="exportexcel()" type="button" class="btn bg-purple btn-sm" style="width:100px;">导出查询</button>
            </div>
        </div>
    </div>

    <div class="col-xs-12">
        <div class="box box-danger">
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
                <table class="table table-striped table-hover">
                    <thead>
                    <tr>
                        <th style="width:35px;">#</th><th>机构名称&编码</th><th>机构类型</th><th>初期余额</th><th>充值</th><th>充值手续费</th><th>提现</th><th>提现手续费</th>
                        <th>留存金额</th><th>手续费</th><th>现金盈亏</th><th>总收益</th><th>关联手续费</th><th>原始手续费</th><th>交易额</th><th>末期余额</th>
                        <th>结算时间</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr v-for="(index, item) in list">
                        <td>{{index+1}}</td><td>{{item.name}}<span style="font-size:11px;color:grey;margin-left:3px;">[{{item.p_code}}{{item.code}}-{{item.level}}]</span></td>
                        <td>{{item.role_name}}</td>
                        <td>{{item.begin_balance | currency ''}}</td><td>{{item.recharge | currency ''}}</td> <td>{{item.recharge_fee | currency ''}}</td>
                        <td>{{item.withdrawals | currency ''}}</td><td>{{item.withdrawals_fee}}</td>
                        <td>{{item.retained_money | currency ''}}</td><td>{{item.fee}}</td>
                        <td>{{item.cash_profit_loss | currency ''}}</td><td>{{item.count_profit}}</td>
                        <td>{{item.relation_fee | currency ''}}</td><td>{{item.original_fee}}</td>
                        <td>{{item.turnover | currency ''}}</td><td>{{item.end_balance}}</td>
                        <td>{{item.settlement_date}}</td>
                    </tr>

                    <td></td><td>汇总：</td><td></td><td></td>
                    <td style="background-color:#ff4053;color:#ffffff;">{{sum.sum_recharge | currency ''}}</td><td style="background-color:#ff4053;color:#ffffff;">{{sum.sum_recharge_fee | currency ''}}</td>
                    <td style="background-color:#ff4053;color:#ffffff;">{{sum.sum_withdrawals | currency ''}}</td><td style="background-color:#ff4053;color:#ffffff;">{{sum.sum_withdrawals_fee}}</td>
                    <td style="background-color:#ff4053;color:#ffffff;">{{sum.sum_retained_money | currency ''}}</td><td style="background-color:#ff4053;color:#ffffff;">{{sum.sum_fee}}</td>
                    <td style="background-color:#ff4053;color:#ffffff;">{{sum.sum_cash_profit_loss | currency ''}}</td><td style="background-color:#ff4053;color:#ffffff;">{{sum.sum_count_profit}}</td>
                    <td style="background-color:#ff4053;color:#ffffff;">{{sum.sum_relation_fee | currency ''}}</td><td style="background-color:#ff4053;color:#ffffff;">{{sum.sum_original_fee}}</td>
                    <td style="background-color:#ff4053;color:#ffffff;">{{sum.sum_turnover | currency ''}}</td>
                    <td></td><td></td>

                    </tbody>
                </table>
            </div>
            <!-- /.box-body -->
            <div class="box-footer clearfix">
                <div id="info_data" class="col-sm-5" style="top:5px;">
                    当前为 {{startRow}} 至 {{endRow}} 条数据，共 {{total}} 条，每页 {{pageSize}} 条
                </div>
                <div class="col-sm-7">
                    <ul id="paging" class="pagination pagination-sm no-margin pull-right">
                        <li><a href="javascript:void(0);" @click="showPage(firstPage)">«</a></li>
                        <li><a href="javascript:void(0);" v-bind:class="{'page_active':pageNum==item}" @click="showPage(item)" v-for="item in navigatepageNums">{{item}}</a></li>
                        <li><a href="javascript:void(0);" @click="showPage(lastPage)">»</a></li>
                    </ul>
                </div>
            </div>
            <div class="overlay hidden">
                <i class="fa fa-refresh fa-spin"></i>
            </div>
        </div>
        <!-- /.box -->
    </div>
</div>

<div class="layui-layer-shade" id="layui-layer-shade" times="1" style="z-index:19891014; background-color:#ffffff; opacity:1; filter:alpha(opacity=1);"></div>
<div class="layui-layer layui-layer-loading  layer-anim" id="layui_layer" type="loading" times="1" showtime="0" contype="string" style="z-index: 19891015;"><div id="" class="layui-layer-content layui-layer-loading0"></div><span class="layui-layer-setwin"></span></div>

<script>
    var root = '__ADMIN__';
    // var data_source = 'tolist';
    var d = "{$d}";
    layuiLayerLoad();
</script>
<script src="__SELF__/js/organizationStatistics/components.js"></script>
<script src="__SELF__/js/organizationStatistics/vue.js"></script>